<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>饼状图</title>
</head>
<body>
    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div id="main" style="height:600px;width:600px;"></div>
    <script type="text/javascript"
            src="/static/js/plugins/echart/echarts-all.js"></script>
        <script type="text/javascript">
         /*基于准备好的dom，初始化echarts实例*/
        var myChart = echarts.init(document.getElementById('main'));

     // 指定图表的配置项和数据 
        var option = {  title: {
            text: '统计报表',
            subtext: '${groupByType}',
            x: 'center'
        },
        tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            x: 'left',
            data:${groupByTypes}
        },
        toolbox: {
            show: true,
            feature: {
                mark: {show: true},
                dataView: {show: true, readOnly: false},
                magicType: {
                    show: true,
                    type: ['pie', 'funnel'],
                    option: {
                        funnel: {
                            x: '25%',
                            width: '50%',
                            funnelAlign: 'left',
                            max: 1667400.00
                        }
                    }
                },
                restore: {show: true},
                saveAsImage: {show: true}
            }
        },
        calculable: true,
        series: [
            {
                name: '未付金额',
                type: 'pie',
                radius: '55%',
                center: ['50%', '60%'],
                data:${datas}
            }
        ]
}
       //将给option替换成对应的报表数据配置即可 

        //使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
        </script>
</body>
</html>